package com.rkc.service;

import com.rkc.model.ProductMessage;
import com.rkc.request.LockProductRequest;
import com.rkc.utils.JsonData;
import com.rkc.vo.ProductVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 冉堃赤
 * @since 2021-10-28
 */
public interface ProductService {

    Map<String, Object> page(int page, int size);

    /**
     * 根据id查找商品详情
     * @param productId
     * @return
     */
    ProductVO detailById(long productId);

    /**
     * 根据id批量查询商品
     * @param productIdList
     * @return
     */
    List<ProductVO> findProductsByIdBatch(List<Long> productIdList);

    /**
     * 锁定商品库存
     * @param lockProductRequest
     * @return
     */
    JsonData lockProductStock(LockProductRequest lockProductRequest);

    /**
     * 释放商品库存
     * @param productMessage
     * @return
     */
    boolean releaseProductStock(ProductMessage productMessage);
}
